package com.cms.meeting.controller;

import com.cms.meeting.entity.Employee;
import com.cms.meeting.entity.Meeting;
import com.cms.meeting.service.MeetingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/admin")
public class ApprovalMeetingController {

    @Autowired
    private MeetingService meetingService;

    @RequestMapping("/approvalMeeting")
    public String getAllMeeting( Model model) {

        model.addAttribute("meeting", meetingService.getAllMeeting());
        return "approvemeeting";
    }
    @RequestMapping("/updatemeetingstatus")
    public String updatemeetingstatus(Integer meetingid, Integer status) {
        Integer result = meetingService.updatestatus(meetingid, status);

        return "redirect:/admin/approvalMeeting";
    }
}
